home *** CD-ROM | disk | FTP | other *** search
/ Software USA 4 #10 / Software USA Volume 4.10.iso / mac / Educational / HTML Vocabulary / HTML Vocabulary 2.0 / HTML Vocabulary 2.0.rsrc / TEXT_1600_Forms.txt < prev    next >
Text File  |  1996-09-28  |  5KB  |  41 lines

  1.  
  2. Forms    
  3. <FORM ACTION="url¬†" METHOD="post|get" [ENCTYPE="enctype¬†"] [TARGET="target¬†"] [NAME="text¬†"]>...</FORM>
  4. This tag starts a new form. ACTION is the URL of a CGI-script (a program on the server), an email address, or a page to which the data will be sent. METHOD is either "post" or "get", depending how the data is to be sent. Using "get", the data will be sent together with the url as "script_name?data", with a maximum of 255 characters. Using "post", the data will be sent hidden from the user. ENCTYPE is the encryption type, such as "text/plain" or "multipart/form-data". Default is "application/x-www-form-urlencoded". NAME is an optional parameter which can be useful when languages like JavaScript are used.
  5.  
  6. Form Objects    
  7. <INPUT [...]>
  8. INPUT is a form object, for example a field. The following parameters may be used:
  9.  
  10. NAME="text "
  11. The name of the object. The result will be sent as 'name=value'.
  12.  
  13. [TYPE="text|password|radio|checkbox|hidden|file|submit|reset|image|button"]
  14. Defines the type of the object. If not defined, "text" will be used. The type can be either a simple text field, a password field with the contents displayed as bullets (‚Ä¢), a radio button where only one can be selected in a group of radiobuttons with the same name, a checkbox, a hidden (invisible) field that cannot be edited, a button to ask the user to upload a file (require special server software), a submit button used to send the form, a button used to reset all objects to their default values or a clickable image used like a submit button. Netscape Navigator and some other browsers may also understand the type "button" for use with JavaScript. A form must have at least one "submit" or "image"-object. If "file" is used, the form must have ENCTYPE set to "multipart/form-data".
  15.  
  16. [VALUE="text "]
  17. The default value of the object, for example "Hello" in a text field. If TYPE is "radio" or "checkbox", the name and value of the object will only be sent if the radiobutton or checkbox is checked. If TYPE is "submit" or "reset", the value will be the name of the submit or reset button. May be used in all objects.
  18.  
  19. [SIZE="n "]
  20. Defines the width of the object in characters. Used in field-objects only.
  21.  
  22. [MAXLENGTH="n "]
  23. Defines the maximum length of the value in characters. Used in field-objects only.
  24.  
  25. [CHECKED]
  26. Set the default highlight of a radiobutton or checkbox to true. Not used in other objects.
  27.  
  28. [SRC="url¬†"] [ALIGN="right|center|left"]
  29. For use with  image-objects only. SRC is required if then while ALIGN is optional. Same use as in the IMG-tag.
  30.  
  31. <SELECT NAME="text¬†" [SIZE="n¬†"] [MULTIPLE]>
  32. Start tag for a popup-menu or a list. Must end with </SELECT>. NAME is the object name and SIZE the number of visible rows. If SIZE is set to 1, or SIZE is not used, a popup-menu will be used. MULTIPLE allows more than one options to be selected by using the command, shift and control keys. Use the following OPTION-tag within the <SELECT> tag.
  33.  
  34. <OPTION [VALUE="text¬†"] [SELECTED]>text
  35. Defines a new menu option. Does not need an end tag. VALUE is the value of the popupmenu that is sent of the specific option is selected, while the text after the tag is what will appear in the popup-menu. Add SELECTED to the item that you wish to be pre-selected when the page is opened.
  36.  
  37. <TEXTAREA NAME="text¬†" [COLS="n¬†"] [ROWS="n¬†"] [WRAP="virtual|physical|off|soft|hard"]>...</TEXTAREA>
  38. Insert a scrollable text field. COLS is the number or columns (horizontal characters) and ROWS the number or rows (vertical characters). WRAP will set the textwrapping to on or off. OFF is the default option, which will insert horizontal scrollbars to the field. Using another parameter, the text will begin on a new line when reaching the right end of the field. Using PHYSICAL or HARD, the text will be sent wrapped. Using VIRTUAL or SOFT, the text will be wrapped in the browser but not sent wrapped. The text between the start and end tags is the default text in the field, for example <TEXTAREA>Hello</TEXTAREA>.
  39. -    
  40. FAQ: How do I use forms without CGI?    
  41. The best way to use forms is together with a CGI-script, but in some cases it may be useful to send the result to an email-address. Not all servers allows CGI-scripts, specially not the free ones like GeoCities. The data is sent to an email account by setting the ACTION-parameter of the FORM-tag to a mail address, as described in the Appendix. You should then also set ENCTYPE to "text/plain", otherwise the text that is sent will be encrypted into an almost unreadable form. You can also use my program Mailto Converter <http://www.calles.pp.se/nisseb/mailto_converter.html> to decrypt the emails, collect them, remove duplicates and do other useful operations, which could be a good idea since some old browsers may not understand "text/plain". You could also use JavaScript or similar languages to process the form data, but I'd not recommend it since not all browsers supports JavaScript (and some users may even have turned it off).